/**
 *
 * author ThuanLT
 * Aug 20, 2014
 *
 */

package vn.fsoft.gst.domain;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

@Entity
@Table(name = "county")
public class County {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "CountyID")
	private int countyID;

	@Column(name = "CountyName")
	private String countyName;
	public County() {}
	public County(String countyName) {
		this.countyName = countyName;
	}

	public int getCountyID() {
		return countyID;
	}

	public void setCountyID(int countyID) {
		this.countyID = countyID;
	}

	public String getCountyName() {
		return countyName;
	}

	public void setCountyName(String countyName) {
		this.countyName = countyName;
	}

	public List<Town> getListTown() {
		return listTown;
	}

	public void setListTown(List<Town> listTown) {
		this.listTown = listTown;
	}

	public List<Address> getListAddress() {
		return listAddress;
	}

	public void setListAddress(List<Address> listAddress) {
		this.listAddress = listAddress;
	}


	@OneToMany(mappedBy = "county")
	@LazyCollection(LazyCollectionOption.FALSE)
	private List<Town> listTown;

	@OneToMany(mappedBy = "county")
	@LazyCollection(LazyCollectionOption.FALSE)
	private List<Address> listAddress;
}
